﻿using Basic.FlowGatewayModule.Interface;
using Basic.FlowRemoteModel.FlowAudit.Model;
using WeDonekRpc.ApiGateway.Attr;
using WeDonekRpc.Client;
using WeDonekRpc.Helper.Validate;
using WeDonekRpc.HttpApiGateway;
using WeDonekRpc.HttpApiGateway.Model;

namespace Basic.FlowGatewayModule.Api
{
    [ApiRouteName("/flow/audit/log/{name}")]
    internal class FlowAuditLogApi : ApiController
    {
        private readonly IFlowAuditLogService _Service;

        public FlowAuditLogApi ( IFlowAuditLogService service )
        {
            this._Service = service;
        }
        public PagingResult<AuditLogItem> Query ( PagingParam<AuditLogQuery> obj )
        {
            return this._Service.Query(obj);
        }
        [ApiPower("all", "flow.audit.close")]
        public void Cancel ( [NumValidate("flow.audit.log.id.error", 1)] long id )
        {
            this._Service.Cancel(id, base.UserState.ToEmpId());
        }
    }
}
